Repository navigation
show counties with name of state - #38132
Merged
Merged
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
PR commands & links...
|
colemanw
reviewed
Nov 17, 2026
Comment on lines
+34
to
+43
| 'columns' => [ | ||
| [ | ||
| 'type' => 'field', | ||
| 'key' => 'name', | ||
| ], | ||
| [ | ||
| 'type' => 'field', | ||
| 'key' => 'state_province_id.name', | ||
| ], | ||
| ], |
Member
There was a problem hiding this comment.
Good idea!
Might this be helpful too? Or too much?
Suggested change
| 'columns' => [ | |
| [ | |
| 'type' => 'field', | |
| 'key' => 'name', | |
| ], | |
| [ | |
| 'type' => 'field', | |
| 'key' => 'state_province_id.name', | |
| ], | |
| ], | |
| 'columns' => [ | |
| [ | |
| 'type' => 'field', | |
| 'key' => 'name', | |
| 'rewrite' => '[name], [state_province_id.abbr]', | |
| ], | |
| [ | |
| 'type' => 'field', | |
| 'key' => 'state_province_id.name', | |
| 'rewrite' => '[state_province_id.name], [state_province_id.country_id.iso_code]', | |
| ], | |
| ], |
Contributor
Author
There was a problem hiding this comment.
Oh, yeah that's a good idea. I'm not sure it is needed in most cases but when it is needed, it will be useful to have. And it doesn't take up that much room. I did find an Ontario county in New York .... but that's a province in canada not a county.... I'm sure there are some counties in different countries with the same name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
In Search Kit, when you add the county field (from the Address object), all counties are displayed, even if you have a state selected in the form. Since many counties in the world have the same name, it's hard to pick the right one. This fix adds the name of the state to the county display instead of the id using the same technique to show the name of the country when displaying state provinces.
Before
Oh no - are there really that many Franklin counties??
After
Now I can find the one for the state I'm looking for:
Technical Details
I just copied the StateProvinceAutocompleteProvider.php file.